import React from 'react';
import {
    Button,
    View,
    Text,
} from 'react-native';

import {
  AppRegistry,
} from 'react-native';

import {DrawerNavigator,TabNavigator,StackNavigator} from 'react-navigation'
import HomeScreen from './app/home'
import DetailScreen from './app/detail'
import SettingScreen from './app/setting'
import FindScreen from './app/find'

const HomeStack = StackNavigator(
  {//定义路由
    Home:{screen:HomeScreen},
    Detail:{screen: DetailScreen},
  },
  {
    navigationOptions:{           //导航栏通用设置
      // header:HeaderComponent,                       //自定义头部组件
      // headerTitle:TitleComponent,                   //自定义标题组件
      // headerLeft:LeftComponent,
      // headerRight:<Text>右边元素</Text>,            //自定义右边元素，注意这里不可以放组件
      // headerBackImage:{uri:'mipmap/ic_launcher'},   //自定义返回按钮的图片
      headerStyle:{                                 //导航栏样式设置
        backgroundColor:'#7276ff'
      },
      headerTintColor:'#fff',                       //按钮、标题颜色设置
      headerTitleStyle:{                            //标题字体样式设置
        fontWeight:'bold',
      },
      // headerTransparent:true,                       //使头部背景透明
      gesturesEnabled:true,                         //开启手势操作
      gestureDirection:'inverted',            //修改返回手势操作方向为从右到左，默认为从左到右
      gestureResponseDistance:{               //定义手势响应距离屏幕边界的距离
        horizontal:100,
        vertical:50
      }
    }
  }
);

const FindStack = StackNavigator(
  {//定义路由
    Setting:{screen:SettingScreen},
    Find:{screen: FindScreen},
  },
  {

  }
);

const RootStack = TabNavigator(
  {//定义路由
    Home:{screen:HomeStack},
    Find:{screen: FindStack},
  },
  {

  }
);

export default class App extends React.Component {
  render() {                            //将Navigation作为根路径导出
    return <RootStack />;
  }
}
